<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>单行溢出文字显示省略号</title>
    <style>
        div{
            width: 150px;
            height: 80px;
            margin: 50px auto;
            background-color: skyblue;
            /* 意思是文字显示不开会自动换行 
             white-space: normal;  */
             /* 文字显示不开也必须强制在一行显示 */
             white-space: nowrap;
             /* 溢出部分隐藏 */
             overflow: hidden;
             /* 文字溢出时用省略号显示 */
             text-overflow: ellipsis;

        }
    </style>
</head>
<body>
    <div>
     噢噢噢噢噢噢噢噢噢噢
    </div>
</body>
</html>